package com.insight.common.message.websocket.handler;

import javax.websocket.Session;
import java.io.IOException;

/**
 * @author JinPengDong
 * @date 2023/2/2
 */
public interface IWebSocketHandler {

    boolean support(String support);

    /**
     * @Description: 初始化
     * @Param:
     * @return:
     * @Author: NoCortY
     * @Date: 2020/3/7
     */
    void onOpenHandler(String code, Session session);

    /**
     * @Description: 处理客户段发的数据
     * @Param:
     * @return:
     * @Author: NoCortY
     * @Date: 2020/3/7
     */
    void onMessageHandler(String buffer, Session session);

    /**
     * @Description: 关闭连接
     * @Param:
     * @return:
     * @Author: NoCortY
     * @Date: 2020/3/7
     */
    void onCloseHandler(Session session) throws IOException;

}
